<template name="work">
	<view class="bg-white" style="height: 100vh;">
		<cu-custom :bgColor="NavBarColor" :isBack="true" backFlag="navigate">
			<block slot="backText">返回</block>
			<block slot="content">工单详情</block>
		</cu-custom>
		<view class="al-list cu-list">
			<view class="message_text bg-white cu-item flex solid-bottom margin-bottom-sm margin-top-sm">
		<view class="content" style="height: auto;width: 100%;">
			<view class="flex justify-start text-cut text-lg" style="color: #333;font-family: '黑体';">
				<view class="padding-left">
					<text class="text-black auto-wrap">{{annotation.description}} </text>
				</view>
			</view>
			<view class="info-item">
				<view class="label text-lg">车牌号</view>
				<view class="text-lg auto-wrap" >{{ annotation.licensePlate}}</view>
			</view>
			<view class="info-item">
				<view class="label text-lg">工单状态</view>
				<view class="text-lg auto-wrap" >{{ annotation.workOrderStatus_dictText}}</view>
			</view>
			<view class="info-item">
				<view class="label text-lg">工单类型</view>
				<view class="text-lg auto-wrap" >{{ annotation.workOrderType_dictText}}</view>
			</view>
			<view class="info-item">
				<view class="label text-lg">创建人</view>
				<view class="text-lg auto-wrap" >{{ annotation.createBy}}</view>
			</view>
			<view class="info-item">
				<view class="label text-lg">客户名称</view>
				<view class="text-lg auto-wrap" >{{ annotation.customerName }}</view>
			</view>
			<view class="info-item">
				<view class="label text-lg">提交时间</view>
				<view class="text-lg auto-wrap" >{{ annotation.createTime }}</view>
			</view>
			<view class="info-item">
				<view class="label text-lg">联系方式</view>
				<view class="text-lg auto-wrap" style="display: flex;align-items: center;" >
					<text>{{ annotation.contacts}} {{ annotation.telephone}}</text>
					<image @click="callPhone(annotation.telephone)" src="../../static/icon/order_tel.png" style="height: 20px; width: 20px;"></image>
				</view>
			</view>
			<view class="info-item">
				<view class="label text-lg">上门地址</view>
				<view class="text-lg auto-wrap" >{{ annotation.address }}</view>
			</view>
			<view class="info-item">
				<view class="label text-lg">服务人员</view>
				<view class="text-lg auto-wrap" >{{ annotation.serviceStaff }}</view>
			</view>
		</view>
		</view>
		</view>
		
		<view class="container">
			<!-- <input type="text" placeholder="请输入搜索内容" @input="onSearchInput" /> -->
			
			  <view class="solid-bottom">
			
			  	<scroll-view scroll-x class="scroll-view">
			  		<!-- <view class="flex text-center justify-around"> -->
			  			<view class="item" :class="item.value==TabCur?'text-blue cur':''" v-for="(item,index) in tabs" :key="index" @tap="tabSelect" :data-id="item.value">
			  				{{item.title}}
			  			</view>
			  		<!-- </view> -->
			  	</scroll-view>
			  </view>
			 <mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top"  @down="downCallback"  @up="upCallback">
				<!-- 数据列表 -->
				<view class="al-list cu-list">
					<view class="message_text bg-white cu-item flex justify-around align-center solid-bottom margin-bottom-sm margin-top-sm" style="width: 100vw;" v-for="(item,index) in msgList" :key="index" :class="modalName=='move-box-'+ index?'move-cur':''"
					  @touchstart="ListTouchStart" @touchend="ListTouchEnd" :data-target="'move-box-' + index">
						<view v-if="TabCur==0" class="tab-content content" style="height: auto;">
							<!-- <view class="flex justify-start text-cut text-lg" style="width:26em;color: #333;font-family: '黑体';">
								<view class="padding-left" style="width: 350px;">
									<text class="text-black auto-wrap">{{item.description}} </text>
								</view>
							</view> -->
							<view class="info-item">
								<view class="label text-lg">公司名称/个人</view>
								<view class="text-lg auto-wrap" >
									{{ item.companyNameIndividual}}
								</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">故障类型</view>
								<view class="text-lg auto-wrap">
										 {{ item.faultType_dictText}}
								</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">图片描述</view>
								<view class="text-lg auto-wrap" >
									<image :src="''+staticDomainURL+'/'+item.pictureDescription+''" mode="widthFix" @touchstart="longPress(''+staticDomainURL+'/'+item.pictureDescription+'')" @touchend="cancelLongPress"></image>
								</view>
							</view>
							
							<view class="info-item">
								<view class="label text-lg">视频描述</view>
								<view class="text-lg auto-wrap">
										 {{ item.videoDescription}}
								</view>
							</view>
							
							<view class="info-item">
								<view class="label text-lg">批量报修</view>
								<view class="text-lg auto-wrap">
									{{ item.batchRepairReporting}}
								</view>
							</view>
						</view>
						<!-- 工单流程 -->
						<view v-if="TabCur==1" class="tab-content content" style="height: auto;">
							<view class="info-item">
								<view class="label text-lg">创建日期</view>
								<view class="text-lg auto-wrap">
									{{ item.createTime}}
								</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">流程状态</view>
								<view class="text-lg auto-wrap">
										 {{ item.status_dictText}}
								</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">流程内容</view>
								<view class="text-lg auto-wrap">
									{{ item.content}}
								</view>
							</view>
						</view>
						<!-- 工单回执 -->
						<view v-if="TabCur==2" class="tab-content content" style="height: auto;">
							<view class="info-item">
								<view class="label text-lg">维护前照片</view>
								<view class="text-lg auto-wrap">
									<image :src="''+staticDomainURL+'/'+item.beforeMaintenance+''" mode="widthFix" @touchstart="longPress(''+staticDomainURL+'/'+item.beforeMaintenance+'')" @touchend="cancelLongPress"></image>
								</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">维护后照片</view>
								<view class="text-lg auto-wrap">
									<image :src="''+staticDomainURL+'/'+item.afterMaintenance+''" mode="widthFix" @touchstart="longPress(''+staticDomainURL+'/'+item.afterMaintenance+'')" @touchend="cancelLongPress"></image>
								</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">故障原因</view>
								<view class="text-lg auto-wrap">{{ item.failureCause}}</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">处理方法</view>
								<view class="text-lg auto-wrap">{{ item.processingMethod }}</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">处理结果</view>
								<view class="text-lg auto-wrap">{{ item.processingResults_dictText }}</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">流量卡</view>
								<view class="text-lg auto-wrap">{{ item.trafficCard }}</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">外协费用</view>
								<view class="text-lg auto-wrap">{{ item.outsourcingExpenses }}</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">审核处理</view>
								<view class="text-lg auto-wrap">{{ item.auditProcessing_dictText }}</view>
							</view>

							<view class="info-item">
								<view class="label text-lg">审核意见</view>
								<view class="text-lg auto-wrap">{{ item.reviewComments }}</view>
							</view>
					
							<view v-if="item.reviewerAutograph" class="info-item">
								<view class="label text-lg">审核人签名</view>
								<view class="text-lg auto-wrap">
									<image :src="''+staticDomainURL+'/'+item.reviewerAutograph+''" mode="widthFix" ></image>
								</view>
							</view>

							<view class="info-item">
								<view class="label text-lg">审核人</view>
								<view class="text-lg auto-wrap">{{ item.reviewer }}</view>
							</view>

							<view class="info-item">
								<view class="label text-lg">审核时间</view>
								<view class="text-lg auto-wrap">{{ item.reviewTime }}</view>
							</view>
						</view>
						<!-- 现场签到 -->
						<view v-if="TabCur==3" class="tab-content content" style="height: auto;">
							<view class="info-item">
								<view class="label text-lg">创建日期{{ TabCur }}</view>
								<view class="text-lg auto-wrap">{{ item.createTime }}</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">详细地址</view>
								<view class="text-lg auto-wrap">{{ item.fullAddress }}</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">现场图片</view>
								<view class="text-lg auto-wrap">
									<image :src="''+staticDomainURL+'/'+item.photos+''" mode="widthFix" ></image>
								</view>
							</view>
						</view>
						<!-- 服务记录 -->
						<view v-if="TabCur==4" class="tab-content content" style="height: auto;">
							<view class="info-item">
								<view class="label text-lg">服务内容</view>
								<view class="text-lg auto-wrap">{{ item.serviceContent }}</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">图片</view>
								<view class="text-lg auto-wrap">
									<image :src="''+staticDomainURL+'/'+item.picture+''" mode="widthFix" ></image>
								</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">视频</view>
								<view class="text-lg auto-wrap"> {{ item.fullAddress}}</view>
							</view>

							<view class="info-item">
								<view class="label text-lg">附件</view>
								<view class="text-lg auto-wrap"> {{ item.fullAddress}}</view>
							</view>

							<view class="info-item">
								<view class="label text-lg">下次服务时间</view>
								<view class="text-lg auto-wrap"> {{ item.nextServiceTime}}</view>
							</view>
						</view>
						<!-- 工单回访 -->
						<view v-if="TabCur==5" class="tab-content content" style="height: auto;">
							<view class="info-item">
								<view class="label text-lg">员工</view>
								<view class="text-lg auto-wrap"> {{ item.createBy }}</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">回访时间</view>
								<view class="text-lg auto-wrap"> {{ item.createTime }}</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">问题处理</view>
								<view class="text-lg auto-wrap"> {{ item.problemHandling_dictText }}</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">收费情况</view>
								<view class="text-lg auto-wrap"> {{ item.fullAddress }}</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">满意程度</view>
								<view class="text-lg auto-wrap"> {{ item.satisfactionLevel_dictText }}</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">回访概述</view>
								<view class="text-lg auto-wrap"> {{ item.overview }}</view>
							</view>
							<view class="info-item">
								<view class="label text-lg">客户建议</view>
								<view class="text-lg auto-wrap"> {{ item.suggested }}</view>
							</view>
						</view>
					</view>
				</view>
			</mescroll-uni>
		</view>
		<view class="tabbar_bottom">
			<view class="footer">
				<view v-if="annotation.workOrderStatus==3" @tap="takingOrders" class="btn">
					<text>接单</text>
				</view>
				<!-- <view class="btn">
					<text>转派</text>
				</view> -->
				<view v-if="annotation.workOrderStatus==15" @tap="appointment" class="btn">
					<text>预约客户</text>
				</view>
				<view v-if="annotation.workOrderStatus==15 || annotation.workOrderStatus==17 || annotation.workOrderStatus==9" @tap="serviceRecordsForm" class="btn">
					<text>服务记录</text>
				</view>
				<view v-if="annotation.workOrderStatus==16" @tap="signInForm" class="btn">
					<text>签到</text>
				</view>
				<view v-if="annotation.workOrderStatus==17" @tap="receiptForm" class="btn">
					<text>回执</text>
				</view>
				<view v-if="annotation.workOrderStatus==9" @tap="receiptReviewForm" class="btn">
					<text>回执审核</text>
				</view>
				<view v-if="annotation.workOrderStatus==12" @tap="followUpForm" class="btn">
					<text>回访</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const tabs = [{title:'工单信息',value:0}, {title:'工单流程',value:1}, {title:'工单回执',value:2}, {title:'现场签到',value:3}, {title:'服务记录',value:4}, {title:'工单回访',value:5},];
	import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
	import configService from '@/common/service/config.service.js'
	
	export default {
		name: 'work',
		props:{
			cur:String,
		},
	    mixins: [MescrollMixin], // 使用mixin
		data() {
			return {
				tabs,
				TabCur: 0,
				scrollLeft: 0,
				NavBarColor:this.NavBarColor,
				annotation:{
					id:"",
					titile:"",
					startTime:"",
					sender:"",
					msgContent:"",
	
				},
				upOption:{
					page: {
						num: 0, // 当前页码,默认0,回调之前会加1,即callback(page)会从1开始
						size: 10 // 每页数据的数量
					},
					noMoreSize: 4, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
					empty:{
						tip: '~ 暂无数据 ~', // 提示
						
					},
					loading:'',
					text:'全部',
					isShowNoMore:false,
					textNoMore:'我是有底线的 >_<'
				},
				msgList: [], //列表数据
			    read: "all",
				announcement1:[],
				msg1Count:"",
				msg1Title:"",
				announcement2:[],
				msg2Count:"",
				msg2Title:"",
				staticDomainURL:configService.staticDomainURL,
				delUrl:'/sys/sysAnnouncementSend/delete',
				queryMaintainOrdersUrl:'/work/workOrder/queryMaintainOrdersByMainId',
				queryInstallationOrderUrl:'/work/workOrder/queryInstallationOrderByMainId',
				queryWorkOrderProcessUrl:'/work/workOrder/queryWorkOrderProcessByMainId',
				queryWorkOrderReceiptUrl:'/work/workOrder/queryWorkOrderReceiptByMainId',
				queryAttendanceRecordUrl:'/work/workOrder/queryAttendanceRecordByMainId',
				queryWorkServiceRecordsUrl:'/work/workOrder/queryWorkServiceRecordsByMainId',
				queryFollowUpUrl:'/work/workOrder/queryFollowUpByMainId',
				receivingOrdersUrl:'/work/workOrder/receivingOrders',
				listTouchStart: 0,
			    modalName: null,
			    listTouchDirection: null,
				searchInput: '', // 用户输入的搜索关键词
			}
		},
		onShow() {
			if(this.mescroll){
				console.log("tabindex==========0000000000")
				this.mescroll.resetUpScroll()
			}
		},
		computed:{
			
			top() {
				return this.CustomBar * 2 + 650
			},
			style() {
				console.log("tabindex==========")
				var StatusBar= this.StatusBar;
				var CustomBar= this.CustomBar;
				var style = `height:${CustomBar}px;padding-top:${StatusBar}px;`;
				return style
			},
		},
		onLoad: function (option) {
			    // const annItem = JSON.parse(decodeURIComponent(option.item));
				console.log("this.$Route.query",this.$Route.query);
				const annItem=this.$Route.query
				// this.model = query;
				console.log("ann",annItem)
				if(annItem.workOrderStatus==3){
					
				}
				this.annotation = annItem 
				// this.readOk();
			},
		methods: {
			longPress(filePath) {
				console.log("filePath========",filePath);
			      this.timeout = setTimeout(() => {
			        this.isLongPress = true;
			        // 执行保存图片的操作
			        uni.saveImageToPhotosAlbum({
			          filePath: filePath, // 图片的本地路径或网络路径
			          success: () => {
			            uni.showToast({ title: '保存成功' });
			          },
			          fail: () => {
			            uni.showToast({ title: '保存失败', icon: 'none' });
			          }
			        });
			      }, 500); // 设置长按的阈值时间，这里是500毫秒
			    },
			    cancelLongPress() {
			      clearTimeout(this.timeout);
			      this.isLongPress = false;
			    },
			callPhone(phoneNumber) {
			    uni.makePhoneCall({
			      phoneNumber: phoneNumber, // 电话号码
			      success: function () {
			        console.log('拨号成功');
			      },
			      fail: function () {
			        console.log('拨号失败');
			      }
			    });
			  },
			onSearchInput(event) {
				this.upOption.page.num=1;
				this.upCallback(this.upOption.page);
			},
			appointment(){
				this.$Router.push({name:'appointmentForm', params:this.annotation})
			},
			signInForm(){
				this.$Router.push({name:'signInForm', params:this.annotation})
			},
			receiptForm(){
				this.$Router.push({name:'receiptForm', params:this.annotation})
			},
			receiptReviewForm(){ //回执审核
				this.$http.get(this.queryWorkOrderReceiptUrl,{params:{id: this.annotation.id}}).then(res=>{
					//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
					this.announcement1 = res.data.result.records
					this.mescroll.endSuccess(this.announcement1.length);
					//console.log("url", res)
					//设置列表数据
					  if (res.data.success) {
						 console.log("res",res.data)
						 // this.msg1Title = "通知(" + res.data.result.total + ")";
						 let workOrderReceiptList=[];
						for(let annItem of this.announcement1){
							workOrderReceiptList.push(annItem)							
						}
						this.annotation.workOrderReceiptList=workOrderReceiptList;
						this.$Router.push({name:'receiptReviewForm', params:this.annotation})
					 }
					
				}).catch(()=>{
					//联网失败, 结束加载
					this.mescroll.endErr();
				})
				
			},
			followUpForm(){
				this.$Router.push({name:'followUpForm', params:this.annotation})
			},
			serviceRecordsForm(){
				this.$Router.push({name:'serviceRecordsForm', params:this.annotation})
			},
			takingOrders(){
				let that = this;
				uni.showModal({
				    title: '提示',
				    content: '你确定要接单吗？',
				    success: function (res) {
				        if (res.confirm) {
				            console.log('用户点击确定');
							that.$http.post(that.receivingOrdersUrl+"?id="+that.annotation.id,{id: that.annotation.id}).then(res=>{
							   console.log("res",res)
							   if(res.data.success){
								   that.$tip.alert(res.data.message);
							   		that.annotation.workOrderStatus=15;
							   }else{
							   		that.$tip.alert(res.data.message);
							   }
							}).catch(()=>{
								// this.loading = false
							});
							
				            // 用户点击了确定，执行相应的逻辑
				        } else if (res.cancel) {
				            console.log('用户点击取消');
				            // 用户点击了取消，执行相应的逻辑
				        }
				    }
				});
			},
			// unique(arr) {
			//     var obj = {};
			//     return arr.filter(function(item, index, arr){
			//         return obj.hasOwnProperty(typeof item + item) ? false : (obj[typeof item + item] = true)
			//     })
			// },
			upCallback(page) {
				//联网加载数据
				console.log("tabindex",this.TabCur )
			
				let keyword = this.TabCur;
				let licensePlateNo;
				
				if(this.annotation.workOrderType==2 && keyword==0){  //维护单
					this.$http.get(this.queryMaintainOrdersUrl,{params:{id: this.annotation.id}}).then(res=>{
						//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
						this.announcement1 = res.data.result.records
						this.mescroll.endSuccess(this.announcement1.length);
						//console.log("url", res)
						//设置列表数据
						  if (res.data.success) {
							 console.log("res",res.data)
							 this.msg1Title = "通知(" + res.data.result.total + ")";
							for(let annItem of this.announcement1){
								this.msgList.push(annItem)							
							}
						 }
						if(page.num == 1){
							this.msgList = []; //如果是第一页需手动制空列表
							this.msgList = this.msgList.concat(this.announcement1); //追加新数据
						}
						
					}).catch(()=>{
						//联网失败, 结束加载
						this.mescroll.endErr();
					})
				}
				
				if(keyword==1){  //工单流程
					this.$http.get(this.queryWorkOrderProcessUrl,{params:{id: this.annotation.id}}).then(res=>{
						//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
						this.announcement1 = res.data.result.records
						this.mescroll.endSuccess(this.announcement1.length);
						//console.log("url", res)
						//设置列表数据
						  if (res.data.success) {
							 console.log("res",res.data)
							 this.msg1Title = "通知(" + res.data.result.total + ")";
							for(let annItem of this.announcement1){
								this.msgList.push(annItem)							
							}
						 }
						if(page.num == 1){
							this.msgList = []; //如果是第一页需手动制空列表
							this.msgList = this.msgList.concat(this.announcement1); //追加新数据
						}
						
					}).catch(()=>{
						//联网失败, 结束加载
						this.mescroll.endErr();
					})
				}
				if(keyword==2){  //工单回执
					this.$http.get(this.queryWorkOrderReceiptUrl,{params:{id: this.annotation.id}}).then(res=>{
						//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
						this.announcement1 = res.data.result.records
						this.mescroll.endSuccess(this.announcement1.length);
						//console.log("url", res)
						//设置列表数据
						  if (res.data.success) {
							 console.log("res",res.data)
							 this.msg1Title = "通知(" + res.data.result.total + ")";
							for(let annItem of this.announcement1){
								this.msgList.push(annItem)							
							}
						 }
						if(page.num == 1){
							this.msgList = []; //如果是第一页需手动制空列表
							this.msgList = this.msgList.concat(this.announcement1); //追加新数据
						}
						
					}).catch(()=>{
						//联网失败, 结束加载
						this.mescroll.endErr();
					})
				}
				if(keyword==3){  //现场签到
					this.$http.get(this.queryAttendanceRecordUrl,{params:{id: this.annotation.id}}).then(res=>{
						//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
						this.announcement1 = res.data.result.records
						this.mescroll.endSuccess(this.announcement1.length);
						//console.log("url", res)
						//设置列表数据
						  if (res.data.success) {
							 console.log("res",res.data)
							 this.msg1Title = "通知(" + res.data.result.total + ")";
							for(let annItem of this.announcement1){
								this.msgList.push(annItem)							
							}
						 }
						if(page.num == 1){
							this.msgList = []; //如果是第一页需手动制空列表
							this.msgList = this.msgList.concat(this.announcement1); //追加新数据
						}
						
					}).catch(()=>{
						//联网失败, 结束加载
						this.mescroll.endErr();
					})
				}
				if(keyword==4){  //服务记录
					this.$http.get(this.queryWorkServiceRecordsUrl,{params:{id: this.annotation.id}}).then(res=>{
						//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
						this.announcement1 = res.data.result.records
						this.mescroll.endSuccess(this.announcement1.length);
						//console.log("url", res)
						//设置列表数据
						  if (res.data.success) {
							 console.log("res",res.data)
							 this.msg1Title = "通知(" + res.data.result.total + ")";
							for(let annItem of this.announcement1){
								this.msgList.push(annItem)							
							}
						 }
						if(page.num == 1){
							this.msgList = []; //如果是第一页需手动制空列表
							this.msgList = this.msgList.concat(this.announcement1); //追加新数据
						}
						
					}).catch(()=>{
						//联网失败, 结束加载
						this.mescroll.endErr();
					})
				}
				if(keyword==5){  //工单回访
					this.$http.get(this.queryFollowUpUrl,{params:{id: this.annotation.id}}).then(res=>{
						//联网成功的回调,隐藏下拉刷新和上拉加载的状态;
						this.announcement1 = res.data.result.records
						this.mescroll.endSuccess(this.announcement1.length);
						//console.log("url", res)
						//设置列表数据
						  if (res.data.success) {
							 console.log("res",res.data)
							 this.msg1Title = "通知(" + res.data.result.total + ")";
							for(let annItem of this.announcement1){
								this.msgList.push(annItem)							
							}
						 }
						if(page.num == 1){
							this.msgList = []; //如果是第一页需手动制空列表
							this.msgList = this.msgList.concat(this.announcement1); //追加新数据
						}
						
					}).catch(()=>{
						//联网失败, 结束加载
						this.mescroll.endErr();
					})
				}
			},
			getTotal(keyword) {
				//联网加载数据
				// console.log("tabindex",this.TabCur )
				let idx = keyword;
				let licensePlateNo;
				if(this.searchInput){
					licensePlateNo='*'+this.searchInput+'*'
				}
				if(keyword == 0){
					keyword="";
				}
				this.$http.get(this.url,{params:{pageNo: 1, pageSize:1,workOrderStatus: keyword,licensePlate:licensePlateNo}}).then(res=>{
					//console.log("url", res)
					//设置列表数据
					  if (res.data.success) {
						 console.log("res",res.data)
						 this['dataCount'+idx]=res.data.result.total;
					 }
					
				}).catch(()=>{
					//联网失败, 结束加载
					this.mescroll.endErr();
				})
			},
			tabSelect(e) {
				this.TabCur = e.currentTarget.dataset.id;
				console.log("this.TabCurthis.TabCur===",this.TabCur);
				this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
				this.msgList = []// 先置空列表,显示加载进度
				this.mescroll.resetUpScroll() // 再刷新列表数据
			},
			goAnnotationDetail(item){
				//item.readFlag = '1'
				this.mescroll.resetUpScroll() 
			    if(item.openType=="component" && item.openPage.indexOf('email')>= 0){
					this.goEmailDetailPage(item)
				}else{
					// console.log("detail",encodeURIComponent(JSON.stringify(item)))
					// console.log("detail",item)
					// console.log("detail",JSON.stringify(item))
					uni.navigateTo({
						url: '/pages/work/detail?item='+ encodeURIComponent(JSON.stringify(item))
					});
				}
			},
			isEmail(item){
				if(item.openType=="component" &&item.openPage.indexOf('email')>=0){
				  return true;
				}else{
				  return false;
				}
		    },
			goEmailDetailPage(item){
				console.log("go",item.anntId)
				console.log("item",item)
				 if(item.readFlag == '0'){
					//item.readFlag = '1'
					this.mescroll.resetUpScroll() 
					let readUrl = '/sys/sysAnnouncementSend/editByAnntIdAndUserId';
					this.$http.put(readUrl,{anntId:item.anntId})					
				}
				// console.log("goe",item.busId)
				
				uni.navigateTo({
					url: '/pages/mail/mailDetail?id='+item.busId
				});
				
			},
			ListTouchStart(e) {
				console.log("tabindex==========44444444")
				console.log("tabindex==========44444444",e.touches[0].pageX)
				this.listTouchStart = e.touches[0].pageX
			},
			
			// ListTouch计算方向
			ListTouchMove(e) {
				console.log("tabindex==========5555555555")
				this.listTouchDirection = e.touches[0].pageX - this.listTouchStart > 0 ? 'right' : 'left'
			},
			
			// ListTouch计算滚动
			ListTouchEnd(e) {
				console.log("tabindex==========88888888")
				if (this.listTouchDirection == 'left') {
					this.modalName = e.currentTarget.dataset.target
				} else {
					this.modalName = null
				}
				this.listTouchDirection = null
				console.log("tabindex==========88888888",this.modalName)
			},
			deleteAnnotation(item) {
				console.log("tabindex==========999999999")
				this.$http.delete(this.delUrl+'?id='+item.id).then(res => {
					console.log("结果数据9", res)
					if (res.data.success) {
						this.mescroll.resetUpScroll() 
					}
				}).catch(e => {
					console.log("al delUrl请求错误2", e)
					this.mescroll.endErr();
				})
			},
			formatDate(text,len){
				console.log("tabindex==========453535353")
				if(!text || text.length==0){
					return ''
				}
				if(text.length<len){
					return text;
				}
				return text.substr(0,len)
			},
			titleFilter(text,len){
				console.log("tabindex==========2323242424")
				if(!text || text.length==0){
					return ''
				}
				if(text.length<len){
					return text;
				}
				return text.substr(0,len)+"..."
			}
			
		}
	}
</script>

<style lang="scss" scoped>
	.e-btn{margin-bottom: 1rem;}

	.titlePad{margin-top:0.6rem;margin-bottom: 1rem;padding-left: 12px;}
	.cu-list>.move-cur{
		transform: translateX(-150rpx);
		
	}
	.nav .cu-item.cur {
		position: flex;
		z-index: 9;
		border-bottom: 4upx solid;
	}
.auto-wrap {
  overflow-wrap: break-word; /* 确保在单词边界上换行 */
  word-wrap: break-word; /* 兼容旧版浏览器 */
  white-space: normal; /* 允许换行 */
}
	.scroll-view {
	  white-space: nowrap;
	  width: 100%;
	}
	 
	.item {
	  display: inline-block;
	  width: 70px;
	  height: 45px;
	  background-color: #f0f0f0;
	  /* margin-right: 10px; */
	  line-height: 45px;
	  text-align: center;
	}
	
	.scroll-view .item.cur {
		position: flex;
		z-index: 9;
		border-bottom: 4upx solid;
	}
	
	.search-container {
	  display: flex;
	  align-items: center;
	  background-color: #f0f0f0;
	  border-radius: 20px;
	  /* padding: 3px; */
	  margin-bottom: 2px;
	}
	 
	.search-input {
	  flex: 1;
	  padding: 10px;
	  border: none;
	  outline: none;
	  font-size: 16px;
	}
	 
	.search-icon {
	  margin-left: 10px;
	  font-size: 18px;
	}
	.tabbar_bottom {
	    position: fixed;
	    left: 0;
	    bottom: 0;
	    height: 54px;
		width: 100%;
	    background: #FFFFFF;
	    padding-left: 15px;
	    padding-right: 15px;
	    padding-bottom: 8px;
	    padding-bottom: constant(safe-area-inset-bottom);
	    padding-bottom: env(safe-area-inset-bottom);
	    box-sizing: content-box;
	    border-top: 0.5px solid #efefef;
	    z-index: 101;
	}
	.tabbar_bottom .footer {
	    padding: 8px 15px;
	    display: flex;
	}
	.tabbar_bottom .footer .btn {
	    width: 80px;
	    height: 40px;
	    border-radius: 5px;
	    line-height: 40px;
	    text-align: center;
	    font-size: 15px;
	    color: #fff;
	    background: blue;
	    margin: 0 2px;
	}
	.tab-content {
		width: 100%;
		padding-bottom: 32px;
	}
	.info-item {
		padding-left: 0.8rem;
		padding-right: 0.8rem;
		width: 100%;
		display: flex;
		margin-top: 5px;
		box-sizing: border-box;
		& > .label {
			width: 80px;
			min-width: 80px;
			color: #808080;
		}
		& > .auto-wrap {
			flex: 1;
			color: rgba(0, 0, 0, 0.85);
			overflow: hidden;
			image {
				width: 100%;
			}
		}
	}
</style>
